'use strict';

const Service = require('egg').Service;

class UserService extends Service {
  async login(user,pwd) {
    console.log(user,pwd);
        let res=await this.app.mysql.query(`select * from user2 where user='${user}' and pwd='${pwd}'`)
        console.log(res);
        return res
  }
  async zc(user){
      let res=await this.app.mysql.query(`select * from user2 where user='${user}'`)
      return res
  }
  async add(user,pwd){
      let res=await this.app.mysql.query(`insert into user2 (user,pwd) values ('${user}','${pwd}')`)
      return res
  }
}

module.exports = UserService;
